﻿<MudGrid>
    <MudItem xs="12" md="6" lg="4">
        <MudChart ChartType="ChartType.Donut" InputData="@Data" InputLabels="@Labels" Width="300px" Height="300px" ChartOptions="@Options1"></MudChart>
    </MudItem>
    <MudItem xs="12" md="6" lg="4">
        <MudChart ChartType="ChartType.Pie" InputData="@Data" InputLabels="@Labels" Width="300px" Height="300px" ChartOptions="@Options1"></MudChart>
    </MudItem>
    <MudItem xs="12" md="6" lg="4">
        <MudChart ChartType="ChartType.Line" ChartSeries="@Series1" XAxisLabels="@XAxisLabels" Width="100%" Height="350px" ChartOptions="@Options1"></MudChart>
    </MudItem>
    <MudItem xs="12" md="6" lg="4">
        <MudChart ChartType="ChartType.Bar" ChartSeries="@Series2" XAxisLabels="@XAxisLabels" Width="100%" Height="350px" ChartOptions="@Options1"></MudChart>
    </MudItem>
    <MudItem xs="12" md="6" lg="4">
        <MudChart ChartType="ChartType.StackedBar" ChartSeries="@Series1" XAxisLabels="@XAxisLabels" Width="100%" Height="350px" ChartOptions="@Options1"></MudChart>
    </MudItem>
    <MudItem xs="12" md="6" lg="4">
        <MudChart ChartType="ChartType.StackedBar" ChartSeries="@Series1" XAxisLabels="@XAxisLabels" Width="100%" Height="350px" ChartOptions="@Options2"></MudChart>
    </MudItem>
</MudGrid>


@code {
    public static string __description__ = "Charts with custom colors using ChartOptions.";

    public double[] Data = { 50, 25, 20, 5, 16, 14, 8, 4, 2, 8, 10, 19, 8, 17, 6, 11, 19, 24, 35, 13, 20, 12 };

    public string[] Labels = { "Deep Sea Blue", "Venetian Red", "Banana Yellow", "La Salle Green", "Rich Carmine", "Shiraz", "Cloud Burst",
                               "Neon Pink", "Ocean", "Orangey Red", "Catalina Blue", "Fountain Blue", "Irish Green", "Wild Strawberry",
                               "Geraldine", "Grey Teal", "Baby Pink", "Thunderbird", "Navy", "Aqua Marina", "Lavender Pinocchio", "Deep Sea Blue"

    };

    public List<ChartSeries> Series1 = new List<ChartSeries>()
    {
        new ChartSeries() { Name = "Deep Sea Blue", Data = new double[] { 40, 20, 25, 27, 46 } },
        new ChartSeries() { Name = "Venetian Red", Data = new double[] { 19, 24, 35, 13, 28 } },
        new ChartSeries() { Name = "Banana Yellow", Data = new double[] { 8, 6, 11, 13, 4 } },
        new ChartSeries() { Name = "La Salle Green", Data = new double[] { 18, 9, 7, 10, 7 } },
        new ChartSeries() { Name = "Rich Carmine", Data = new double[] { 9, 14, 6, 15, 20 } },
        new ChartSeries() { Name = "Shiraz", Data = new double[] { 9, 4, 11, 5, 19 } },
        new ChartSeries() { Name = "Cloud Burst", Data = new double[] { 14, 9, 20, 16, 6 } },
        new ChartSeries() { Name = "Neon Pink", Data = new double[] { 14, 8, 4, 14, 8 } },
        new ChartSeries() { Name = "Ocean", Data = new double[] { 11, 20, 13, 5, 5 } },
        new ChartSeries() { Name = "Orangey Red", Data = new double[] { 6, 6, 19, 20, 6 } },
        new ChartSeries() { Name = "Catalina Blue", Data = new double[] { 3, 2, 20, 3, 10 } },
        new ChartSeries() { Name = "Fountain Blue", Data = new double[] { 3, 18, 11, 12, 3 } },
        new ChartSeries() { Name = "Irish Green", Data = new double[] { 20, 5, 15, 16, 13 } },
        new ChartSeries() { Name = "Wild Strawberry", Data = new double[] { 15, 9, 12, 12, 1 } },
        new ChartSeries() { Name = "Geraldine", Data = new double[] { 5, 13, 19, 15, 8 } },
        new ChartSeries() { Name = "Grey Teal", Data = new double[] { 12, 16, 20, 16, 17 } },
        new ChartSeries() { Name = "Baby Pink", Data = new double[] { 1, 18, 10, 19, 8 } },
        new ChartSeries() { Name = "Thunderbird", Data = new double[] { 15, 16, 10, 8, 5 } },
        new ChartSeries() { Name = "Navy", Data = new double[] { 16, 2, 3, 5, 5 } },
        new ChartSeries() { Name = "Aqua Marina", Data = new double[] { 17, 6, 11, 19, 6 } },
        new ChartSeries() { Name = "Lavender Pinocchio", Data = new double[] { 1, 11, 4, 18, 1 } },
        new ChartSeries() { Name = "Deep Sea Blue", Data = new double[] { 1, 11, 4, 18, 1 } }
    };

    public List<ChartSeries> Series2 = new List<ChartSeries>()
    {
        new ChartSeries() { Name = "Deep Sea Blue", Data = new double[] { 40, 20, 25, 27, 46 } },
        new ChartSeries() { Name = "Venetian Red", Data = new double[] { 19, 24, 35, 13, 28 } },
        new ChartSeries() { Name = "Banana Yellow", Data = new double[] { 8, 6, 11, 13, 4 } },
    };

    public string[] XAxisLabels = { "1", "2", "3", "4", "5" };


    private ChartOptions Options1 = new ChartOptions()
    {
        ChartPalette = new string[] { "#015482", "#CC1512", "#FFE135", "#087830", "#D70040", "#B20931", "#202E54", "#F535AA", "#017B92",
                                      "#FA4224", "#062A78", "#56B4BE", "#207000", "#FF43A4", "#FB8989", "#5E9B8A", "#FFB7CE", "#C02B18",
                                      "#01153E", "#2EE8BB", "#EBDDE2"
        },
    };

    private ChartOptions Options2 = new ChartOptions()
    {
        ChartPalette = new string[] { "#5bdfeb" },
        ShowLegend = false
    };

}